package com.wgchao.identityrightsmanagement.infrastructure.convert;

import com.wgchao.identityrightsmanagement.domain.resource.model.ProjectResources;
import com.wgchao.identityrightsmanagement.infrastructure.jpa.entity.SysResourceProject;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

/**
 * @ClassName: ProjectConvert
 * @author: wgchao
 * @createTime: 2020/6/18 9:47 AM
 * @Description: TODO
 */
@Component
public class ProjectConvert {

    public ProjectResources convert(SysResourceProject sysResourceProject) {
        ProjectResources projectResources = new ProjectResources(sysResourceProject.getId(), sysResourceProject.getProMark(),
                sysResourceProject.getProName(), sysResourceProject.getDescription(), sysResourceProject.isDisabled(), sysResourceProject.getVersion());
        return projectResources;
    }

    public SysResourceProject convert(ProjectResources projectResources) {
        SysResourceProject sysResourceProject = new SysResourceProject();
        BeanUtils.copyProperties(projectResources, sysResourceProject);
        return sysResourceProject;
    }

}
